package game.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import game.rule.Rule;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * \* Created: fank
 * \* Date: 2018/5/28
 * \* Time: 14:43
 * \* @desc: 初始化桌子信息
 */
public class InitDesk {
    /** 下注索引列表*/
    private Integer[] betArea;
    /** 背包金币*/
    private long myMoney;
    /** 昵称*/
    private String myName;
    /** vip*/
    private int myVip;
    /** 头像*/
    private String myHeadUrl;
    /** 总线*/
    private int myYaXian = Rule.getSize();
    /** 剩余免费次数*/
    private int freeCount;
    /** 总免费次数*/
    private int totalFreeCount;
    /** 免费中获得的总金币*/
    private long freeMoney;
    /** 是否可以购买，保留连击的服务*/
    private boolean isBuy;
    /** 已经购买的次数*/
    private int buyTimes;
    /** 上一轮押注索引*/
    private int betIndex;
    /** 购买次数对应，扣除倍数*/
    private List<Integer> buy2Bets;
    /**小游戏列表*/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<MGameVo> mlist;

    public InitDesk() {
    }

    public InitDesk(Integer[] betArea, long myMoney, String myName, int myVip, String myHeadUrl,
                    int freeCount, int totalFreeCount, long freeMoney, boolean isBuy, int buyTimes, int betIndex,
                    Map<Integer, Integer> buy2Bets, List<MGame> mlist) {
        this.betArea = betArea;
        this.myMoney = myMoney;
        this.myName = myName;
        this.myVip = myVip;
        this.myHeadUrl = myHeadUrl;
        this.freeCount = freeCount;
        this.totalFreeCount = totalFreeCount;
        this.freeMoney = freeMoney;
        this.isBuy = isBuy;
        this.buyTimes = buyTimes;
        this.betIndex = betIndex;
        this.buy2Bets = buy2Bets.values().stream().sorted().collect(Collectors.toList());
        if (mlist != null && !mlist.isEmpty()) {
            this.mlist = new ArrayList<>();
            mlist.forEach(mGame -> this.mlist.add(mGame.toVo()));
        }
    }

    public Integer[] getBetArea() {
        return betArea;
    }

    public void setBetArea(Integer[] betArea) {
        this.betArea = betArea;
    }

    public long getMyMoney() {
        return myMoney;
    }

    public void setMyMoney(long myMoney) {
        this.myMoney = myMoney;
    }

    public String getMyName() {
        return myName;
    }

    public void setMyName(String myName) {
        this.myName = myName;
    }

    public int getMyVip() {
        return myVip;
    }

    public void setMyVip(int myVip) {
        this.myVip = myVip;
    }

    public String getMyHeadUrl() {
        return myHeadUrl;
    }

    public void setMyHeadUrl(String myHeadUrl) {
        this.myHeadUrl = myHeadUrl;
    }

    public int getMyYaXian() {
        return myYaXian;
    }

    public void setMyYaXian(int myYaXian) {
        this.myYaXian = myYaXian;
    }

    public int getFreeCount() {
        return freeCount;
    }

    public void setFreeCount(int freeCount) {
        this.freeCount = freeCount;
    }

    public int getTotalFreeCount() {
        return totalFreeCount;
    }

    public void setTotalFreeCount(int totalFreeCount) {
        this.totalFreeCount = totalFreeCount;
    }

    public long getFreeMoney() {
        return freeMoney;
    }

    public void setFreeMoney(long freeMoney) {
        this.freeMoney = freeMoney;
    }

    public boolean isBuy() {
        return isBuy;
    }

    public void setBuy(boolean buy) {
        isBuy = buy;
    }

    public int getBuyTimes() {
        return buyTimes;
    }

    public void setBuyTimes(int buyTimes) {
        this.buyTimes = buyTimes;
    }

    public int getBetIndex() {
        return betIndex;
    }

    public void setBetIndex(int betIndex) {
        this.betIndex = betIndex;
    }

    public List<Integer> getBuy2Bets() {
        return buy2Bets;
    }

    public void setBuy2Bets(List<Integer> buy2Bets) {
        this.buy2Bets = buy2Bets;
    }

    public List<MGameVo> getMlist() {
        return mlist;
    }

    public void setMlist(List<MGameVo> mlist) {
        this.mlist = mlist;
    }
}



